package com.example.testapplication;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * @author wwq on 2019/7/18  16:07.
 */
public class MainFragmentAdapter extends FragmentPagerAdapter {
    MainFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new home_page();
                break;
            case 1:
                fragment = new QuestionList();
                break;
            case 2:
                fragment = new MenuProject();
                break;
            case 3:
                fragment = new MenuExpert();
                break;
            case 4:
                fragment = new minePage();
                break;
            default:
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 5;
    }
}
